package com.sntk.registermanager.staff.infrastructure.commit.impl;

import com.alibaba.fastjson.JSONObject;
import com.sntk.registermanager.staff.domain.model.Affiliation;
import com.sntk.registermanager.staff.infrastructure.commit.AffiliationCommit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

/**
 * @author liuyunxia
 */
@Component("affiliationStaffCommitImpl")
public class AffiliationCommitImpl implements AffiliationCommit {

    @Override
    public Affiliation searchAffiliation(String institutionNumber) {

//        String organStr =  organDispatch.searchOrgan(institutionNumber);
//        if(ObjectUtils.isEmpty(organStr)){
//            return null;
//        }
//        JSONObject jsonObject = JSONObject.parseObject(organStr);
//        return new Affiliation(jsonObject.getString("institutionNumber"),
//                jsonObject.getString("institutionName"),
//                jsonObject.getBoolean("disabled"));
        return new Affiliation("3702",
                "系统",
                false);
    }
}
